package com.kefu.call.vo;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.kefu.call.model.CallSipuser;
import com.kefu.common.context.KefuContext;
import com.kefu.common.vo.AbstractSearchVo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import org.apache.commons.lang3.StringUtils;

/**
 * @author CodeGenerator
 * @date 2022/07/24
 */
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@ApiModel(description = "SIP用户")
public class CallSipuserSearchVo extends AbstractSearchVo {

    @ApiModelProperty(value = "账号")
    private String sipUser;


	 @Override
    public  LambdaQueryWrapper<CallSipuser> lambdaQuery(){
    	LambdaQueryWrapper<CallSipuser> wrapper=Wrappers.<CallSipuser>lambdaQuery();
	    wrapper.like(StringUtils.isNotBlank(sipUser), CallSipuser::getSipUser, sipUser);//账号
	    wrapper.eq(CallSipuser::getCompany, KefuContext.getTid());//公司id
	    
    	return wrapper;
	}
}